package com.spring.pay.weixin.util;

import java.util.Random;

import com.spring.pay.weixin.config.WeiXinConfig;

public class WXUtil {
	
	//产生32位随机字符串
	public static String getNonceStr() {
		Random random = new Random();
		return MD5Util.MD5Encode(String.valueOf(random.nextInt(10000)), WeiXinConfig.INPUT_CHARSET);
	}

	//产生10位数的当前时间
	public static String getTimeStamp() {
		return String.valueOf(System.currentTimeMillis() / 1000);
	}
	
	public static void main(String[] arg){
		System.out.println("aaaaa:"+getTimeStamp());
		System.out.println("bbbbb:"+getNonceStr());
	}
}
